Skip to content

#672: #592-D: register GTK scroll surfaces + hit-test caches on the live path, then delete src/gtk/draw.rs - #687

Merged
JDonaghy merged 2 commits into
developfrom
issue-672-592-d-register-gtk-scroll-surfaces-hit-t
Aug 28, 2026
Merged

#672: #592-D: register GTK scroll surfaces + hit-test caches on the live path, then delete src/gtk/draw.rs#687
JDonaghy merged 2 commits into
developfrom
issue-672-592-d-register-gtk-scroll-surfaces-hit-t

Conversation

@JDonaghy

Copy link
Copy Markdown
Owner

Closes #672

Automated PR opened by coordinator for review of issue #672.

JDonaghy and others added 2 commits August 28, 2026 05:31
… the live path, delete src/gtk/draw.rs

`src/gtk/draw.rs` (3,733 lines under a file-level `#![allow(dead_code)]`)
had zero live callers after the #540 Relm4->ShellApp migration, but it was
still the sole writer of two live-read caches:

- `engine.scroll_surfaces`: GTK's `dispatch_scroll`/`dispatch_click` hit-test
  this list every event, but under `ShellApp` nothing ever cleared or
  registered it for the editor's own scroll paths — the terminal/debug-output
  registrations #670 already ported were never cleared each frame, so stale
  entries could accumulate. Now cleared and re-registered at the top of
  every `render_content` pass, matching TUI's `render_impl.rs`.
- `status_segment_map`: `click.rs`'s `pixel_to_click_target` reads this to
  resolve per-window/separated status bar segment clicks (goto-line,
  change-language, switch-branch, ...) to a `StatusAction`, but nothing
  populated it live, so those clicks silently resolved to `ClickTarget::None`.
  Now populated from `backend.status_bar_layout()`'s hit regions right after
  each status bar paints.
- `sync_ui_font_size`/`UI_FONT()`/`UI_FONT_FAMILY`: re-homed into `mod.rs`
  (still live — read by the raw-Pango chrome) and wired to run once per
  frame, fixing a latent bug where the UI font size atomic never updated
  from settings (its only caller was dead code).

Also deleted `src/gtk/quadraui_gtk.rs`: `q_theme()` and its two
`RICH_TEXT_POPUP_SB_*` constants had no production caller left once
`draw.rs` was gone (only a test used `q_theme`, now switched to the
`render::to_quadraui_theme` it wrapped), and the two constants had zero
callers anywhere.

Added a GtkDriver test that opens the debug-output panel, dispatches a
wheel scroll over it, and asserts `debug_output_scroll` advances — this
fails red against an empty `scroll_surfaces` list and only passes once the
surface is actually registered.

No file under src/gtk/ carries a file-level #![allow(dead_code)] anymore.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…parated status line dispatch

Review requested a driver test proving status_segment_map's per-window and
separated-status-line click sites (mod.rs) are actually wired live, not just
populated. Writing that test for the separated status line surfaced a real
bug: unlike the per-window status bar (resolved via ScreenZone::Window ->
WindowZone::StatusBar), the separated line paints in its own full-width band
outside every window's rect, and pixel_to_click_target had no zone type that
ever reached it — every click there silently missed (ClickTarget::None),
even after #672's paint-time registration fix.

Fixes it with a small shared render.rs helper, status_bar_zone_hit_test,
that hit-tests an absolute point against a painted bar rect + its
status_segment_map zones (mirrors the per-window arm's contract but doesn't
require a window rect). click.rs's pixel_to_click_target now checks the
separated status bar first, keyed by active_window_id, before falling
through to the existing window/tab-bar zone resolution. Threaded a new
separated_status_bar parameter through pixel_to_click_target and its three
wrapper functions (handle_mouse_click, handle_mouse_double_click,
handle_mouse_drag) and all call sites.

Added:
- gtk::testing::status_bar_segment_click_opens_go_to_line_picker: clicks the
  per-window status bar's live Ln/Col segment and asserts the go-to-line
  picker actually paints (picker_popup_rect), not just an engine flag flip.
- gtk::testing::separated_status_line_segment_click_opens_go_to_line_picker:
  same proof for the separated status line, the test that caught the dead
  dispatch path above.
- Two new Harness accessors (status_segment_center,
  separated_status_segment_center) that locate a segment's painted pixel
  target from status_segment_map, and a small separated_status_bar_rect App
  field (mirroring the existing picker_popup_rect/tab_switcher_popup_rect
  "painted rect for click+test" pattern) so a test can find the separated
  bar without re-deriving compute_editor_layout's stacking arithmetic.
- Three render::tests unit tests pinning status_bar_zone_hit_test's
  contract directly (bar-rect bounds check, gap-between-segments miss).

cargo build/test/clippy/fmt all clean.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@JDonaghy
JDonaghy merged commit 4fc41fc into develop Aug 28, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

#592-D: register GTK scroll surfaces + hit-test caches on the live path, then delete src/gtk/draw.rs

1 participant